package com.xyzq.dao.ya.hibernate;

import java.util.Date;
import java.util.List;

import org.appfuse.dao.hibernate.GenericDaoHibernate;
import org.springframework.stereotype.Repository;

import com.xyzq.dao.ya.AccountDayStockDAO;
import com.xyzq.model.ya.data.Account;
import com.xyzq.model.ya.data.AccountDayStock;

@Repository("accountDayStockDao")
public class AccountDayStockDaoHibernate extends
		GenericDaoHibernate<AccountDayStock, Long> implements
		AccountDayStockDAO {

	public AccountDayStockDaoHibernate() {
		super(AccountDayStock.class);
	}

	public List<AccountDayStock> findWithValueDate(Date valueDay) {
		// TODO Auto-generated method stub
		return this.getHibernateTemplate().find(
				"from AccountDayStock where day=?", valueDay);
	}

	public List<AccountDayStock> findWithValueDate(Date valueDay,
			Account account) {
		// TODO Auto-generated method stub
		return this.getHibernateTemplate().find(
				"from AccountDayStock where day=? and FK_ACCOUNT_ACCOUNT=?",
				valueDay, account.getId());
	}

}
